from selenium.webdriver.common.by import By

class PageEcshopFrontAddShopingCar():
    def __init__(self,driver):
        self.driver = driver #控制浏览器

    #定义定位器
        self.loc_ele_find_add_goods = (By.XPATH,'//form[@id="ECS_FORMBUY"]/ul[3]/li[2]/a/img')
    def ele_find_add_goods(self):#点击加入购物车
        self.driver.find_element(*self.loc_ele_find_add_goods).click()

    def search(self):
        self.ele_find_add_goods()
